<%@ page language="java" pageEncoding="ISO8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title></title>
	
	<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="js/amq_jquery_adapter.js"></script>
	<script type="text/javascript" src="js/amq.js"></script>

	<script language="JavaScript">
		var amq = org.activemq.Amq;
		amq.init({
			uri: 'amq',
			logging: true,
			timeout: 20,
			clientId:(new Date()).getTime().toString()
		});

		amq.addListener("myID",
			"topic://mytest",
			function(message){
				alert(message);
			});

		var go = function(){
			var myMessage = document.getElementById("cctext").value;
			var uid = document.getElementById("uid").value;
			amq.sendMessage(myDestination, "<message type='"+ uid +"' from='" + myMessage + "'/>");
		};
	</script>
</head>

<body>
	<textarea rows="10" cols="50" id="distext"></textarea>
	<br>
	aaa:<input type="TEXT" id="uid"/><br>
	bbb:<input type="TEXT" id="cctext"/><br>
	<input type="button" value="go" onclick="go()"/>
</body>
</html>